import { onBeforeMount, onMounted, ref } from "vue";
export const useResize = (w2) => {
  const width = ref(w2);
  const Fn = function () {
    console.log(document.body.offsetWidth);
    width.value = document.body.offsetWidth - 100;
  };
  onMounted(() => {
    Fn();
    window.addEventListener("resize", Fn);
  });
  onBeforeMount(() => {
    window.removeEventListener("resize", Fn);
  });
  return {
    width,
  };
};
